Doors DXL Question

I have String formated input from file.I want ot use as my access to work in script

string strAccess="read|modify"

Item itm = item valproject
Permission p1 = strAccess
set(itm,p1,null)

  #### Note: this want I got from my file####

I am getting error! kindly help

 

 

 

 


MohanRS - Mon Sep 23 10:32:55 EDT 2013

Re: Doors DXL Question
llandale - Mon Sep 23 12:30:28 EDT 2013

Let me scribble:

Permission fPermisOf(string in_string)
{  // Turn the string into a Permission
   Permission ret_p = none()
   if (matches("read",    in_string)) then ret_p = ret_p | read()
   if (matches("write",   in_string)) then ret_p = ret_p | modify() | create() | delete()
   if (matches("modify",  in_string)) then ret_p = ret_p | modify()
   if (matches("create",  in_string)) then ret_p = ret_p | create()
   if (matches("delete",  in_string)) then ret_p = ret_p | delete()
   if (matches("control", in_string)) then ret_p = ret_p | control()
   if (matches("change",  in_string)) then ret_p = ret_p | control()
  return(ret_p)
}  // end fPermissOf(string)

-Louie

Re: Doors DXL Question
MohanRS - Tue Sep 24 09:15:15 EDT 2013

llandale - Mon Sep 23 12:30:28 EDT 2013

Let me scribble:

Permission fPermisOf(string in_string)
{  // Turn the string into a Permission
   Permission ret_p = none()
   if (matches("read",    in_string)) then ret_p = ret_p | read()
   if (matches("write",   in_string)) then ret_p = ret_p | modify() | create() | delete()
   if (matches("modify",  in_string)) then ret_p = ret_p | modify()
   if (matches("create",  in_string)) then ret_p = ret_p | create()
   if (matches("delete",  in_string)) then ret_p = ret_p | delete()
   if (matches("control", in_string)) then ret_p = ret_p | control()
   if (matches("change",  in_string)) then ret_p = ret_p | control()
  return(ret_p)
}  // end fPermissOf(string)

-Louie

Thanks , it works!